//定义模块
var app = angular.module('pinyougou',[]);

//从集合中按照key查询对象
$scope.searchObjectByKey=function (list,key,keyValue) {
    for (var i =0;i<list.length;i++){
        if(list[i][key] == keyValue){
            return list[i];
        }
    }
    return null;
}